//
//  ViewController.m
//  UI03_homework
//
//  Created by aaaaaa on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "ActivityUIView.h"
#import "ActivityIntroduceUIView.h"

@interface ViewController ()

@property (nonatomic, retain) NSArray *array;

@end

@implementation ViewController

- (void)dealloc
{
    [_array release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createData];
    [self createTiteleLable];
    [self createActivityIconAndActivitySpecific];
    [self creareActivityIntroduce];
}

- (void)createTiteleLable{
    UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 414, 100)];
    titleLable.text = @"赵雷2014新专辑《吉姆餐厅》首发演唱会，北京站";
    titleLable.font = [UIFont boldSystemFontOfSize:22];
    titleLable.numberOfLines = 2;
    [self.view addSubview:titleLable];
    [titleLable release];
}

- (void)createActivityIconAndActivitySpecific{
    
    [self createActivityIcon];
    [self createActivitySpecitic];
}

- (void)createActivityIcon{
    UIImage *activityIcon = [UIImage imageNamed:@"image.jpg"];
    UIImageView *activityIconImageView = [[UIImageView alloc] initWithImage:activityIcon];
    activityIconImageView.frame =CGRectMake(10, 120, 160, 167);
    [self.view addSubview:activityIconImageView];
    [activityIconImageView release];
}

- (void)createActivitySpecitic{
    ActivityUIView *time = [[ActivityUIView alloc] initWithFrame:CGRectMake(160, 120, 414 - 160, 25) withImageName:@"time.png" withLableText:@"10-19 18:00 -- 10-19 23:30"];
    [self.view addSubview:time];
    
    ActivityUIView *owner = [[ActivityUIView alloc] initWithFrame:CGRectMake(160, 160, 414 - 160, 25) withImageName:@"owner.png" withLableText:@"赵雷"];
    [self.view addSubview:owner];
    
    ActivityUIView *category = [[ActivityUIView alloc] initWithFrame:CGRectMake(160, 200, 414 - 160, 25) withImageName:@"category.png" withLableText:@"类型：音乐"];
    [self.view addSubview:category];
    
    ActivityUIView *address = [[ActivityUIView alloc] initWithFrame:CGRectMake(160, 240, 414 - 160, 50) withImageName:@"address.png" withLableText:@"北京 东城区 北京市东城区和平里西街79号糖果大楼三层"];
    [self.view addSubview:address];
    
}

- (void)creareActivityIntroduce{
    
    ActivityIntroduceUIView *activityIntroduce = [[ActivityIntroduceUIView alloc] initWithFrame:CGRectMake(10, 340, 404, 400)];
    [self.view addSubview:activityIntroduce];
    [activityIntroduce release];
    
    
    for (int i = 0; i < self.array.count; i++) {
        [activityIntroduce addUILableWithText:self.array[i] withLableFrame:CGRectMake(0, 40 + 30 * i, 404, 30)];
    }
   
    
    
}

- (void)createData{
    self.array = @[@"【新专辑2014全国巡演合作咨询】",
                       @"@蒋步庭",
                       @"微博http://weibo.com/jiangbuting",
                       @"豆瓣http://www.douban.com/people/jiangjin/",
                       @"QQ1193657158",
                       @"邮箱1193657158@qq.com",
                       @"手机18610967776",
                       @"【赵雷巡演两千人群241855614】",
                       @"【赵雷歌迷北京活动群189347699】",
                       @"—— —— —— —— ——  —— —— —— —— ——"
                       ];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}















@end
